Telegram Group & Telegram Channel
Задача с кодом. Слияние списков

Напишите функцию, которая будет проверять, можно ли из чисел во вложенном списке составить целевой список.

Функция принимает список списков и целевой список и возвращает True или False.

Порядок чисел в списках не имеет значения (см. пример 2).

Из всех чисел во вложенном списке должен получиться набор чисел из целевого списка в точности. Не может быть ни лишних чисел (включая повторы), ни недостающих (см. примеры 3 и 4).

Примеры:

canConcatenate([[1, 2, 3, 4], [5, 6], [7]], [1, 2, 3, 4, 5, 6, 7]) 
➞ True
canConcatenate([[2, 1, 3], [5, 4, 7, 6]], [7, 6, 5, 4, 3, 2, 1])
➞ True

canConcatenate([[2, 1, 3], [5, 4, 7, 6, 7]], [1, 2, 3, 4, 5, 6, 7])
➞ False
# В целевом списке только одна 7, а во вложенном их две.

canConcatenate([[2, 1, 3], [5, 4, 7]], [1, 2, 3, 4, 5, 6, 7])
➞ False
# Во вложенном списке нет 6.

Решение на нашем сайте.

#задача #coding



tg-me.com/pythonist_ru/2469
Create:
Last Update:

Задача с кодом. Слияние списков

Напишите функцию, которая будет проверять, можно ли из чисел во вложенном списке составить целевой список.

Функция принимает список списков и целевой список и возвращает True или False.

Порядок чисел в списках не имеет значения (см. пример 2).

Из всех чисел во вложенном списке должен получиться набор чисел из целевого списка в точности. Не может быть ни лишних чисел (включая повторы), ни недостающих (см. примеры 3 и 4).

Примеры:

canConcatenate([[1, 2, 3, 4], [5, 6], [7]], [1, 2, 3, 4, 5, 6, 7]) 
➞ True
canConcatenate([[2, 1, 3], [5, 4, 7, 6]], [7, 6, 5, 4, 3, 2, 1])
➞ True

canConcatenate([[2, 1, 3], [5, 4, 7, 6, 7]], [1, 2, 3, 4, 5, 6, 7])
➞ False
# В целевом списке только одна 7, а во вложенном их две.

canConcatenate([[2, 1, 3], [5, 4, 7]], [1, 2, 3, 4, 5, 6, 7])
➞ False
# Во вложенном списке нет 6.

Решение на нашем сайте.

#задача #coding

BY Pythonist.ru - образование по питону


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/pythonist_ru/2469

View MORE
Open in Telegram


Pythonist ru образование по питону Telegram | DID YOU KNOW?

Date: |

How Does Bitcoin Work?

Bitcoin is built on a distributed digital record called a blockchain. As the name implies, blockchain is a linked body of data, made up of units called blocks that contain information about each and every transaction, including date and time, total value, buyer and seller, and a unique identifying code for each exchange. Entries are strung together in chronological order, creating a digital chain of blocks. “Once a block is added to the blockchain, it becomes accessible to anyone who wishes to view it, acting as a public ledger of cryptocurrency transactions,” says Stacey Harris, consultant for Pelicoin, a network of cryptocurrency ATMs. Blockchain is decentralized, which means it’s not controlled by any one organization. “It’s like a Google Doc that anyone can work on,” says Buchi Okoro, CEO and co-founder of African cryptocurrency exchange Quidax. “Nobody owns it, but anyone who has a link can contribute to it. And as different people update it, your copy also gets updated.”

Look for Channels Online

You guessed it – the internet is your friend. A good place to start looking for Telegram channels is Reddit. This is one of the biggest sites on the internet, with millions of communities, including those from Telegram.Then, you can search one of the many dedicated websites for Telegram channel searching. One of them is telegram-group.com. This website has many categories and a really simple user interface. Another great site is telegram channels.me. It has even more channels than the previous one, and an even better user experience.These are just some of the many available websites. You can look them up online if you’re not satisfied with these two. All of these sites list only public channels. If you want to join a private channel, you’ll have to ask one of its members to invite you.

Pythonist ru образование по питону from id


Telegram Pythonist.ru - образование по питону
FROM USA